/* @file runtime_stub.h
 *
 * Copyright (c) Huawei Technologies Co., Ltd. 2023. All Rights reserved.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
#ifndef UT_TESTCASE_C_RUNTIME_STUB_H_
#define UT_TESTCASE_C_RUNTIME_STUB_H_

#include <gmock/gmock.h>
#include "runtime/base.h"
#include "runtime/mem.h"
#include "runtime/rt.h"
#include "acl_base.h"
#include "acl_rt.h"

class RuntimeStubMock {
public:
  static RuntimeStubMock& GetInstance() {
    static RuntimeStubMock mock;
    return mock;
  }
  MOCK_METHOD0(rtInit, rtError_t());
  MOCK_METHOD2(rtSubscribeReport, rtError_t(uint64_t threadId, rtStream_t stream));
  MOCK_METHOD2(rtUnSubscribeReport, rtError_t(uint64_t threadId, rtStream_t stream));
  MOCK_METHOD4(rtCallbackLaunch, rtError_t(rtCallback_t callBackFunc, void *fnData, rtStream_t stream, bool isBlock));
  MOCK_METHOD1(rtProcessReport, rtError_t(int32_t timeout));

  MOCK_METHOD2(rtSubscribeHostFunc, rtError_t(uint64_t threadId, rtStream_t stream));
  MOCK_METHOD2(rtUnSubscribeHostFunc, rtError_t(uint64_t threadId, rtStream_t stream));
  MOCK_METHOD1(rtProcessHostFunc, rtError_t(int32_t timeout));
  MOCK_METHOD1(rtCtxGetCurrent, rtError_t(rtContext_t *ctx));
  MOCK_METHOD1(rtGetRunMode, rtError_t(rtRunMode *mode));
  MOCK_METHOD2(rtStreamCreateWithConfig, rtError_t(rtStream_t *stream, rtStreamConfigHandle *handle));
};

rtError_t rtGetRunMode_Device_Normal_Invoke(rtRunMode *mode);
#endif